<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/9/16
  Time: 14:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>Sheraton酒店管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/public.css" media="all" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui_ext/dtree/dtree.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui_ext/dtree/font/dtreefont.css">
</head>
<body class="childrenBody">
<!-- 搜索条件开始 -->
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>查询条件</legend>
</fieldset>
<form class="layui-form" method="post" id="searchFrm">

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户昵称:</label>
            <div class="layui-input-inline" style="padding: 5px">
                <input type="text" name="loginName" id="loginName" autocomplete="off" class="layui-input layui-input-inline"
                       placeholder="请输入客户昵称" style="height: 30px;border-radius: 10px">
            </div>
            <label class="layui-form-label">房号:</label>
            <div class="layui-input-inline" style="padding: 5px">
                <input type="text" name="hId" autocomplete="off" class="layui-input layui-input-inline"
                       placeholder="请输入房号" style="height: 30px;border-radius: 10px">
            </div>
        </div>

        <div class="layui-inline" style="text-align: center">
            <button type="button"
                    class="layui-btn layui-btn-normal layui-icon layui-icon-search layui-btn-radius layui-btn-sm"
                    lay-submit  lay-filter="doSearch" style="margin-top: 4px">查询
            </button>
            <button type="reset"
                    class="layui-btn layui-btn-warm layui-icon layui-icon-refresh layui-btn-radius layui-btn-sm"
                    style="margin-top: 4px">重置
            </button>
        </div>
    </div>

</form>


<div id="content" style="">
    <blockquote class="layui-elem-quote" style="margin-top: 10px">
        <div id="test2">
            订房流水单检查
        </div>
    </blockquote>
    <form class="layui-form" method="post" id="checkFrm" lay-filter="checkFrm">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">流水单号:</label>
                <div class="layui-input-inline" style="padding: 5px;width: 280px">
                    <input type="text" name="checkId" id="checkId" readonly="readonly"
                           class="layui-input layui-input-inline"
                           placeholder="请输入流水单号" style="height: 30px;border-radius: 10px;width: 280px">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">客户昵称:</label>
                <div class="layui-input-inline" style="padding: 5px;width: 280px">
                    <input type="text" name="loginName1" id="loginName1" readonly="readonly" autocomplete="off"
                           class="layui-input layui-input-inline"
                           placeholder="请输入客户昵称" style="height: 30px;border-radius: 10px;width: 280px">
                </div>
            </div>
        </div>
        <input type="hidden" id="hId" name="hId">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">房间设施有无损坏:</label>
                <div class="layui-input-inline" style="padding: 5px;width: 280px">
                    <input type="text" name="problem" id="problem" required  lay-verify="required" autocomplete="off"
                           class="layui-input layui-input-inline"
                           placeholder="房间设施有无损坏" style="height: 30px;border-radius: 10px;width: 280px">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">订房时间:</label>
                <div class="layui-input-inline" style="padding: 5px;width: 280px">
                    <input type="text" name="starttime" id="starttime" required  lay-verify="required"
                           class="layui-input layui-input-inline"
                           placeholder="请输入订房时间" style="height: 30px;border-radius: 10px;width: 280px">
                </div>
            </div>
        </div>
        <div class="layui-form-item" style="text-align: center">
            <button type="button" lay-submit lay-filter="doSubmit"
                    class="layui-btn layui-btn-normal layui-icon layui-icon-release layui-btn-radius layui-btn-sm"
                    lay-filter="doSubmit" lay-submit style="margin-top: 4px">保存
            </button>
        </div>
    </form>
    <%--出租单信息，车辆信息，客户信息的展示--%>
    <div style="padding: 10px; background-color: #F2F2F2;">
        <div class="layui-row layui-col-space10">
            <div class="layui-col-md4 layui-col-sm4">
                <div class="layui-card">
                    <div class="layui-card-header">客房信息</div>
                    <label class="layui-form-label">房号:</label>
                    <div class="layui-card-body" id="hotelId"></div>
                    <label class="layui-form-label">房间类型:</label>
                    <div class="layui-card-body" id="hotelType"></div>
                    <label class="layui-form-label">房间价格:</label>
                    <div class="layui-card-body" id="hotelPrice"></div>
                    <label class="layui-form-label">房间描述:</label>
                    <div class="layui-card-body" id="hotelDescription"></div>
                    <div class="layui-card-body">
                        房间图片：<img src="" width="200" height="150" id="hotelImg">
                    </div>
                </div>
            </div>

            <div class="layui-col-md4 layui-col-sm4">
                <div class="layui-card">
                    <div class="layui-card-header">客户信息</div>
                    <label class="layui-form-label">客户昵称:</label>
                    <div class="layui-card-body" id="customer_loginName"></div>
                    <label class="layui-form-label">客户性别:</label>
                    <div class="layui-card-body" id="customer_sex"></div>
                    <label class="layui-form-label">住址:</label>
                    <div class="layui-card-body" id="customer_address"></div>
                    <label class="layui-form-label">电话号码:</label>
                    <div class="layui-card-body" id="customer_phone"></div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/index.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/cache.js"></script>
<script>
    var tab;
    layui.use(
        ['table','jquery','layer','form'],function(){
            var table = layui.table;
            var form = layui.form;
            var $ = layui.jquery;
            var layer = layui.layer;

            form.on('submit(doSearch)',function(data1){
                var param = $("#searchFrm").serialize()
                $.get("${pageContext.request.contextPath}/room/checkCustomerIfRent?"+param,function(r){
                    if(r.code==0){
                        layer.msg(r.msg)
                        return false;
                    }
                    $.get("${pageContext.request.contextPath}/room/roomRelativeInfo?"+param,function(rr){
                        $("#hotelId").text(rr.data.room.hId)
                        $("#hId").val(rr.data.room.hId)
                        $("#hotelType").text(rr.data.room.hotelType)
                        $("#hotelPrice").text(rr.data.room.price)
                        $("#hotelDescription").text(rr.data.room.description)
                        $("#hotelImg").attr("src",rr.data.room.hotelImg)
                        $("#customer_loginName").text(rr.data.customer.loginName)
                        if(rr.data.customer.sex==0){
                            $("#customer_sex").text("女")
                        }else {
                            $("#customer_sex").text("男")
                        }
                        $("#customer_address").text(rr.data.customer.address)
                        $("#customer_phone").text(rr.data.customer.phone)
                        $("#checkId").val(rr.data.check.checkId)
                        $("#loginName1").val(rr.data.check.loginName)
                        $("#starttime").val(rr.data.check.starttime)
                    })
                })
            })
            form.on('submit(doSubmit)',function(data){
                var param = $("#checkFrm").serialize()
                layer.confirm("确定要提交该数据么", function (rr) {
                    $.get("${pageContext.request.contextPath}/room/returnRoom?" + param, function (rrr) {
                        layer.msg(rrr.msg)
                    })
                })
            })
        })
</script>

</body>
</html>
